﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Chinaer.DTO;
using System.ServiceModel;
using System.ServiceModel.Web;
using System.ComponentModel;

namespace Chinaer.WCF.Contracts
{
    public partial interface IChinaer
    {
        /// <summary>
        /// 根据店铺ID获取店铺信息
        /// </summary>
        /// <param name="dianPuID"></param>
        /// <returns></returns>
        [OperationContract]
        [WebInvoke(Method = "GET",
            BodyStyle = WebMessageBodyStyle.Bare,
            RequestFormat = WebMessageFormat.Json,
            ResponseFormat = WebMessageFormat.Json,
            UriTemplate = "GetDianPuInfo/{dianPuID}/{apiToken}")]
        [Description("根据店铺编号获取店铺信息")]
        DianPuDTO GetDianPuInfo(string dianPuID,string apiToken);

        [OperationContract]
        [WebInvoke(Method = "POST",
            BodyStyle = WebMessageBodyStyle.Bare,
            RequestFormat = WebMessageFormat.Json,
            ResponseFormat = WebMessageFormat.Json,
            UriTemplate = "UpdateDianPuInfo")]
        [Description("更新店铺信息")]
        Chinaer.Model.Common.JsonResult UpdateDianPuInfo(DianPuDTO dianPuDTO);

        [OperationContract]
        [WebInvoke(Method = "GET",
            BodyStyle = WebMessageBodyStyle.Bare,
            RequestFormat = WebMessageFormat.Json,
            ResponseFormat = WebMessageFormat.Json,
            UriTemplate = "DeleteDianPu/{dianPuID}/{apiToken}")]
        [Description("根据编号删除店铺")]
        Chinaer.Model.Common.JsonResult DeleteDianPuByID(string dianPuID, string apiToken);

        [OperationContract]
        [WebInvoke(Method = "POST",
            BodyStyle = WebMessageBodyStyle.Bare,
            RequestFormat = WebMessageFormat.Json,
            ResponseFormat = WebMessageFormat.Json,
            UriTemplate = "DeleteDianPu")]
        [Description("删除店铺")]
        Chinaer.Model.Common.JsonResult DeleteDianPu(DianPuDTO dianPuDTO);

        [OperationContract]
        [WebInvoke(Method = "POST",
            BodyStyle = WebMessageBodyStyle.Bare,
            RequestFormat = WebMessageFormat.Json,
            ResponseFormat = WebMessageFormat.Json,
            UriTemplate = "AddDianPu")]
        [Description("添加店铺")]
        Chinaer.Model.Common.JsonResult AddDianPu(DianPuDTO dianPuDTO);

        [OperationContract]
        [WebInvoke(Method = "GET",
            BodyStyle = WebMessageBodyStyle.Bare,
            RequestFormat = WebMessageFormat.Json,
            ResponseFormat = WebMessageFormat.Json,
            UriTemplate = "GetDianPuByShangJiaID/{shangJiaID}/{apiToken}")]
        [Description("根据商家编号获取店铺信息")]
        DTO.DianPuDTO GetDianPuByShangJiaID(string shangJiaID,string apiToken);

        /// <summary>
        /// 获取所有的店铺列表
        /// </summary>
        /// <param name="apiToken"></param>
        /// <returns></returns>
        List<DTO.DianPuDTO> GetAllDianPus(string apiToken);
    }
}
